package com.my.zidingyikongjian.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.my.zidingyikongjian.R;
import com.my.zidingyikongjian.view.five.MyView;
import com.my.zidingyikongjian.view.five.MyViewFour;
import com.my.zidingyikongjian.view.five.MyViewThree;
import com.my.zidingyikongjian.view.five.MyViewTwo;

public class FiveActivity extends AppCompatActivity {
    private String flag;
    private MyView myView1;
    private MyViewTwo myView2;
    private MyViewThree myView3;
    private MyViewFour myView4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_five);
        Intent dataIntent = getIntent();
        flag = dataIntent.getStringExtra("five");

        initView();
    }

    private void initView() {
        myView1 = findViewById(R.id.mv_one);
        myView2 = findViewById(R.id.mv_two);
        myView3 = findViewById(R.id.mv_three);
        myView4 = findViewById(R.id.mv_four);

        if (flag != null) {
            if (flag.equals("1")) {
                myView1.setVisibility(View.VISIBLE);
            } else if (flag.equals("2")) {
                myView2.setVisibility(View.VISIBLE);
            } else if (flag.equals("3")) {
                myView3.setVisibility(View.VISIBLE);
            } else if (flag.equals("4")) {
                myView4.setVisibility(View.VISIBLE);
            }
        }
    }
}
